package MediaOnline.Adapter;

import MediaOnline.Data.FilmCatData;
import MediaOnline.GUI.R;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class smallTextListViewAdapter extends BaseAdapter {

	public static Context ctx;
	
	public smallTextListViewAdapter(Context ctx){
		this.ctx=ctx;
	}
	
	public int getCount() {
		// TODO Auto-generated method stub
		return FilmCatData.lstFilmCatID.size();
	}

	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View row = convertView;
        
        if(row == null)
        {
            LayoutInflater inflater = ((Activity)ctx).getLayoutInflater();
            row = inflater.inflate(R.layout.smalltextlist, parent, false);
        }

        TextView txtTheLoai= (TextView)row.findViewById(R.id.txtTheLoai);
        txtTheLoai.setText(FilmCatData.lstFilmCatName.get(position));
        
        
        return row;
	}

}
